﻿#ifndef SERVERWINDOW_H
#define SERVERWINDOW_H

#include "server_class_def.h"

#include <QWidget>
#include <QVector>
#include <QMutex>

namespace Ui { class ServerWindow; }

class ServerWindow : public QWidget{
    Q_OBJECT

public:
    explicit ServerWindow(QWidget *parent=nullptr);
    ~ServerWindow(void);

private:
    void InitConn();
    void InitView();
    Ui::ServerWindow *ui;
    QMutex *mtx_;
    ServerThread *server_thread_;
    bool is_log_recording_;
    std::string log_filepath_;

signals:
    void SignalShowMsg(QString str);
    void SignalShowWarning(QString warning_msg);

public slots:
    void OnPushButtonStartEndClicked(void);
    void OnShowMsg(QString msg);
    void OnPushButtonSaveConfigClicked(void);
    void OnShowWarning(QString warning_msg);
    void OnPushButtonSoftRestartClicked(void);
};

#endif
